using System;
using InfoTech.Mvc.Core.Models;
using InfoTech.Utilities.Reflection;
using System.ComponentModel.DataAnnotations;
using InfoTech.Mvc.Core.UI.Validation;
using InfoTech.LanTranh.MucVu.Bussiness;

namespace InfoTech.Mvc.LanTranh.MucVu.Models
{
    [Serializable]
    public partial class GIAOPHANModel : ObjModel<GIAOPHAN>, IModelConverter
    {

        #region Constructor

        public GIAOPHANModel()
            : base()
        {
        }

        public GIAOPHANModel(GIAOPHAN obj)
            : base(obj)
        {
        }

        #endregion

        #region Fields

        private System.Guid? _magiaophan;

        private System.Guid? _machaxu;

        private System.String _tengiaophan;

        private System.String _diachi;

        private System.String _dienthoai;

        private System.Boolean? _isdata;

        private System.Boolean? _isdefault;

        #endregion

        #region Properties

        //[Store]
        //[Required(ErrorMessage = "Value is required")]
        //[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
        //[StringLength(0)]
        //[EmailRegx]
        //[NumberRegx]
        //[RealNumberRegx]
        //[IntergerRegx]
        //[RealIntergerRegx]
        public System.Guid? MAGIAOPHAN
        {
            get
            {
                return _magiaophan;
            }
            set
            {
                _magiaophan = value;
            }
        }

        //[Store]
        //[Required(ErrorMessage = "Value is required")]
        //[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
        //[StringLength(0)]
        //[EmailRegx]
        //[NumberRegx]
        //[RealNumberRegx]
        //[IntergerRegx]
        //[RealIntergerRegx]
        public System.Guid? MACHAXU
        {
            get
            {
                return _machaxu;
            }
            set
            {
                _machaxu = value;
            }
        }

        //[Store]
        [Required(ErrorMessage = "Value is required")]
        //[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
        [StringLength(1000, ErrorMessage = "Value must be under 1000 characters")]
        //[EmailRegx]
        //[NumberRegx]
        //[RealNumberRegx]
        //[IntergerRegx]
        //[RealIntergerRegx]
        public System.String TENGIAOPHAN
        {
            get
            {
                return _tengiaophan;
            }
            set
            {
                _tengiaophan = value;
            }
        }

        //[Store]
        //[Required(ErrorMessage = "Value is required")]
        //[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
        [StringLength(1000, ErrorMessage = "Value must be under 1000 characters")]
        //[EmailRegx]
        //[NumberRegx]
        //[RealNumberRegx]
        //[IntergerRegx]
        //[RealIntergerRegx]
        public System.String DIACHI
        {
            get
            {
                return _diachi;
            }
            set
            {
                _diachi = value;
            }
        }

        //[Store]
        //[Required(ErrorMessage = "Value is required")]
        //[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
        [StringLength(20, ErrorMessage = "Value must be under 20 characters")]
        //[EmailRegx]
        //[NumberRegx]
        //[RealNumberRegx]
        //[IntergerRegx]
        //[RealIntergerRegx]
        public System.String DIENTHOAI
        {
            get
            {
                return _dienthoai;
            }
            set
            {
                _dienthoai = value;
            }
        }

        //[Store]
        //[Required(ErrorMessage = "Value is required")]
        //[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
        //[StringLength(0)]
        //[EmailRegx]
        //[NumberRegx]
        //[RealNumberRegx]
        //[IntergerRegx]
        //[RealIntergerRegx]
        public System.Boolean? ISDATA
        {
            get
            {
                return _isdata;
            }
            set
            {
                _isdata = value;
            }
        }

        //[Store]
        //[Required(ErrorMessage = "Value is required")]
        //[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
        //[StringLength(0)]
        //[EmailRegx]
        //[NumberRegx]
        //[RealNumberRegx]
        //[IntergerRegx]
        //[RealIntergerRegx]
        public System.Boolean? ISDEFAULT
        {
            get
            {
                return _isdefault;
            }
            set
            {
                _isdefault = value;
            }
        }

        #endregion

        #region IModelConverter

        public System.Type Reflector()
        {
            return typeof(GIAOPHANModel);
        }
        public object GetModel()
        {
            return this;
        }

        #endregion

        #region Overrides of Model<GIAOPHAN>

        public override void ReverttoModel()
        {
            CreateModel(this);
        }

        public override GIAOPHAN ReverttoBussiness()
        {
            return CreateBussiness(this);
        }

        #endregion

        #region Operators

        public static implicit operator GIAOPHANModel(GIAOPHAN obj)
        {
            return new GIAOPHANModel(obj);
        }
        public static implicit operator GIAOPHAN(GIAOPHANModel obj)
        {
            return obj.ReverttoBussiness();
        }

        #endregion

    }
}
